local thbattle__hongmeiling_beishui = fk.CreateSkill {

  name = "thbattle__hongmeiling_beishui",

  tags = { Skill.Wake, },

}



thbattle__hongmeiling_beishui:addEffect(fk.EventPhaseStart, {
  anim_type = "big",
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(thbattle__hongmeiling_beishui.name) and player.phase == Player.Start and
        player:usedSkillTimes(thbattle__hongmeiling_beishui.name, Player.HistoryGame) == 0
  end,
  can_wake = function(self, event, target, player, data)
    local room = player.room
    return not table.find(room.alive_players, function(p)
      return p.hp < player.hp
    end) and player.hp <= 2
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    room:changeMaxHp(player, -1)
    room:handleAddLoseSkills(player, "thbattle__hongmeiling_taiji")
  end
})

return thbattle__hongmeiling_beishui